package com.example.myapplication.a_mvp.presenter;

import com.example.mvp.mvp.presenter.BasePresenter;
import com.example.myapplication.a_mvp.contract.MyContract;
import com.example.myapplication.b_entity.Login_Entity;
import com.example.myapplication.b_entity.Reg_Entity;

import javax.inject.Inject;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

public class MyPresenter extends BasePresenter<MyContract.MyModel, MyContract.MyView> {
    @Inject
    public MyPresenter(MyContract.MyModel mymodel, MyContract.MyView myview) {
        super(mymodel, myview);
    }

    public void reg(String name, String pass) {
        mymodel.reg(name, pass, new Observer<Reg_Entity>() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onNext(Reg_Entity reg_entity) {

                myview.show_reg(reg_entity);
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }


}
